<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Simi Change Password</title>

<script type="text/javascript">
	function validate_form(){
	
	    valid = true;
		var invalid = " "; // Invalid character is a space	
	    if (document.change.old.value == "" ){
	        alert ("Please fill in the 'old' password.");
	        valid = false;
	    }else if(document.change.new.value == "" ){
	        alert ("Please fill in the 'new' password.");
	        valid = false;
	    }else if(document.change.confirm.value == "" ){
	        alert ("Please fill in the 'confirm' password.");
	        valid = false;
	    }else if(document.change.new.value != document.change.confirm.value){
	        alert ("New and Confirm do not match");
	        valid = false;
	    }else if(document.change.new.value.length < 5){
	        alert ("Passwords must be at least 5 characters");
	        valid = false;
	    }else if(document.change.new.value.length > 12){
	        alert ("Passwords must be at most 12 characters");
	        valid = false;
	    }else if (document.change.new.value.indexOf(invalid) > -1) {
			alert("Sorry, spaces are not allowed.");
			return false;
		}
	
	    return valid;
	}
</script>

</head>

<body>
 <div id="content">
 <h2 id="pageName">Simi: Change Password</h2>
 <p>
 <form name='change' id='change' method='post' 
	action='ChangePassword' onsubmit="return validate_form()">
 <input type='submit' value='change password' class='simibutton'>
 old:&nbsp;<input type='password' name='old' id='old'>
 new:&nbsp;<input type='password' name='new' id='new'>
 confirm:&nbsp;<input type='password' name='confirm' id='confirm'></form> 
 </p>
 </div>
</body></html>